import { useContext } from 'react';

import { ModalContext } from '@/shared/context/ModalContext';
import { Modals } from '@/shared/interfaces';

export const useCreateOrderModal = (id: number | string) => {
  const { openModal, setData, data } = useContext(ModalContext);
  const handleBuy = () => {
    setData(() => ({ ...data, id }));
    openModal(Modals.CreateOrderModal);
  };
  return {
    handleBuy,
  };
};
